﻿using UnityEngine;
using System.Collections;
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace testName
{
    public class globleTest :ScriptableObject
    {
        public static void test()
        {
            Type type = System.Type.GetType("testName.globleTest");
            string fullName = type.FullName;
            string name = type.Name;
            Debug.Log(fullName);
            Debug.Log(name);
        }

        public static void test2()
        {
            test test1 = ScriptableObject.CreateInstance<test>();
            AssetDatabase.CreateAsset(test1, "Assets/Data/" + "testScriptable" + ".asset");
            //AssetDatabase.SaveAssets();

            test test2 = ScriptableObject.CreateInstance<test>();
            AssetDatabase.CreateAsset(test2, "Assets/Data/" + "testScriptable2" + ".asset");

            test1.theTest = test2;

            AssetDatabase.SaveAssets();
        }
    }

}
public class test : ScriptableObject {

    public string str = "teststr";
    public int mun = 10;

    public test theTest;

    public test()
    {
        Debug.Log("构造");
        str = "aaaa";
    }

    public void OnEnable()
    {
        Debug.Log("OnEnable");
    }

    public void OnDisable()
    {
        Debug.Log("OnDisable");
    }

    public void OnDestroy()
    {
        Debug.Log("OnDestroy");
    }
}




